package com.xyz.service;

import com.xyz.dto.CountDto;
import com.xyz.dto.HomeLocalDateDto;
import com.xyz.dto.SelectPageAllDto;
import com.xyz.entity.pojo.EquipmentTree;
import com.xyz.entity.pojo.RepairWorkOrder;
import com.xyz.entity.pojo.SystemDictData;
import com.xyz.util.dto.LoginInfo;

import java.util.List;
import java.util.Map;

public interface CommonService {

    // 加载员工数据
    void updateEmployeeMap() throws Exception;

    // 目录相关
    List<Map<String, Object>> getDirectory(int type, long roleId) throws Exception;

    // 根据dictTypeCode获取dictValue:dictName的Map，用于字典值快速转为中文
    Map<Integer, String> getDictMap(String... dictTypeCode) throws Exception;

    // 统计转开始结束时间
    HomeLocalDateDto selectCountTime(CountDto cd) throws Exception;

    // 根据类型获取各模块管理员的idList
    // type：1设备管理员，2维修管理员，3维保管理员，4巡检管理员，5备件管理员
    List<Long> selectManagerUserIdList(int type) throws Exception;

    // 新增消息提醒-通知
    void insertMessageInform(long userId, String title, String content, int businessType, int businessGroup, Long businessId, String businessCode) throws Exception;

    // 新增消息提醒-待办
    void insertMessageBacklog(long userId, String title, String content, int businessType, int businessGroup, Long businessId, String businessCode) throws Exception;

    // 设备日志
    void insertEquipmentOperationLog(long emId, long employeeId, String operation) throws Exception;

    List<RepairWorkOrder> getRepairWorkOrderAll(LoginInfo loginInfo, SelectPageAllDto selectPageAllDto) throws Exception;

    List<RepairWorkOrder> getAppRepairWorkOrderAll(LoginInfo loginInfo, SelectPageAllDto selectPageAllDto) throws Exception;

    String getEmployeeNameById(Long employeeId);

    // 根据dictTypeCode获取List
    List<SystemDictData> getSysDateListByCode(String dictTypeCode);

    //根据设备ID获取子系统树
    EquipmentTree getTree2ByEmId(Long emId);

    Map<Long,EquipmentTree> getEquipmentTreeMap();
    //根据子系统获取区域
    String getTreeStrById(Map<Long, EquipmentTree> treeMap, Long treeId);

    //生成维保工单号
    String getBxWorkOrderCode();

    //生成巡检单号
    String getPatrolCode();
}
